package lcy.homework02;

/**
 * @ClassName: TestRectangle
 * @Description:
 * @author: 李春洋
 * @date: 2024/3/30 17:27
 * @Blog: https://
 */
public class TestRectangle {
    public static void main(String[] args) {
        Rectangle rectangle1 = new Rectangle();
        System.out.println("长方形 1:");
        System.out.println("左上顶点: " + rectangle1.getLeftTop().x + ", " + rectangle1.getLeftTop().y);
        System.out.println("右上顶点: " + rectangle1.getRightTop().x + ", " + rectangle1.getRightTop().y);
        System.out.println("左下顶点: " + rectangle1.getLeftFloor().x + ", " + rectangle1.getLeftFloor().y);
        System.out.println("右下顶点: " + rectangle1.getRightFloor().x + ", " + rectangle1.getRightFloor().y);
        System.out.println("周长: " + rectangle1.calculatePerimeter());
        System.out.println("面积: " + rectangle1.calculateArea());

        Rectangle rectangle2 = new Rectangle(1.0, 1.0, 3.0, 4.0);
        System.out.println("\n长方形 2:");
        System.out.println("左上顶点: " + rectangle2.getLeftTop().x + ", " + rectangle2.getLeftTop().y);
        System.out.println("右上顶点: " + rectangle2.getRightTop().x + ", " + rectangle2.getRightTop().y);
        System.out.println("左下顶点: " + rectangle2.getLeftFloor().x + ", " + rectangle2.getLeftFloor().y);
        System.out.println("右下顶点: " + rectangle2.getRightFloor().x + ", " + rectangle2.getRightFloor().y);
        System.out.println("周长: " + rectangle2.calculatePerimeter());
        System.out.println("面积: " + rectangle2.calculateArea());

        Point p1 = new Point(2.0, 2.0);
        Point p2 = new Point(5.0, 5.0);
        Rectangle rectangle3 = new Rectangle(p1, p2);
        System.out.println("\n长方形 3:");
        System.out.println("左上顶点: " + rectangle3.getLeftTop().x + ", " + rectangle3.getLeftTop().y);
        System.out.println("右上顶点: " + rectangle3.getRightTop().x + ", " + rectangle3.getRightTop().y);
        System.out.println("左下顶点: " + rectangle3.getLeftFloor().x + ", " + rectangle3.getLeftFloor().y);
        System.out.println("右下顶点: " + rectangle3.getRightFloor().x + ", " + rectangle3.getRightFloor().y);
        System.out.println("周长: " + rectangle3.calculatePerimeter());
        System.out.println("面积: " + rectangle3.calculateArea());
    }
}
